<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body style="height: 3000px;">
    <div id="app">
        <home></home>
        <!-- <home2></home2> -->
    </div>

    <script src="./vue.js"></script>
    <script>
        // 定义一个混入 mixin
        let mixin1 = {
            data(){
                return {
                    arr:[1,2,3,4]
                }
            },
            methods:{
                fn(){
                    console.log("111111")
                }
            }
        }
        let Home = {
            template: `
                <div>
                    我是home1
                    {{arr}}
                </div>
            `,
            data() {
                return {
                   arr:['香蕉','苹果']
                }
            },
            mounted(){
                this.fn();
            },
            
           mixins:[mixin1]
        }
        let Home2 = {
            template: `
                <div>
                    我是home2
                    {{arr}}
                </div>
            `,
            data() {
                return {
                   
                }
            },
            mounted(){
                this.fn();
            },
            methods:{
            }
        }
        Vue.component("Home", Home)
        // Vue.component("Home2", Home2)
        let vm = new Vue({
            el: "#app"
        })
    </script>
</body>

</html>